<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>后台管理系统</title>
	    <meta name="author" content="BaiYY"/>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	    <meta name="renderer" content="webkit">
	    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/bootstrap.min.css"/>
	    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/Font/css/font-awesome.min.css"/>
	    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/index.css"/>
	    <script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js"></script>
	    <script type="text/javascript" src="__PUBLIC__/admin/js/bootstrap.min.js"></script>
	    <script type="text/javascript" src="__PUBLIC__/admin/js/index.js"></script>
	</head>
	<body>
		
		<!--右边侧栏开始-->
		<div class="right-sidebar" style="max-width: 1200px;">
			<h4>个人资料</h4>
			<div class="row">
				<div class="bs-bg-classes col-md-4">
					<p class="bg-primary" style="line-height: 50px;text-indent: 20px;">我的推荐码：{$user.user_id}</p>
				</div>
			</div>
		
			<div class="row">
				<div class="col-md-4">
		            <div class="input-group">
		                <span class="input-group-addon">代理级别</span>
		                <input type="text" class="form-control" name="agent_name" id="agent_name" value="{$agent.agent_name}" disabled="disabled" >
		            </div>
		            <div class="input-group">
		                <span class="input-group-addon">手机号码</span>
		                <input type="text" class="form-control" name="tel" id="tel" value="{$user.tel}" disabled="disabled" >
		            </div>
		            <div class="input-group">
		                <span class="input-group-addon">注册时间</span>
		                <input type="text" class="form-control" name="create_time" id="create_time" value="{$user.create_time|date='Y-m-d H:i:s',###}" disabled="disabled" >
		            </div>
					<div class="input-group">
						<span class="input-group-addon">真实姓名</span>
						<input type="text" class="form-control" name="name" id="name1" value="{$user.name}" >
					</div>
					<div class="input-group">
						<span class="input-group-addon">身份证号</span>
						<input type="text" class="form-control" name="card_id" id="card_id" value="{$user.card_id}" >
					</div>
					<div class="input-group">
						<span class="input-group-addon">开户银行</span>
						<input type="text" class="form-control" name="bank_name" id="bank_name" value="{$user.bank_name}" >
					</div>
		            <div class="input-group">
		                <span class="input-group-addon">银行账号</span>
		                <input type="text" class="form-control" name="bank_card" id="bank_card" value="{$user.bank_card}" >
		            </div>
		
		            <p></p>
					<button type="submit" class="btn btn-primary center-block" id="submit">修改</button>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			$("#submit").on("click",function(){
				var name = $.trim($("#name1").val());
				var card_id = $.trim($("#card_id").val());
				var	bank_name = $.trim($('#bank_name').val());
			 	var bank_card = $.trim($('#bank_card').val());
			 	
			 	var params = {'bank_name':bank_name, 'bank_card':bank_card,'name':name,'card_id':card_id};
   				var url = "{:U('Admin/Main/userInfoSave')}";
   				
   				$.ajax({
   					type:"post",
   					url:url,
   					dataType:"json",
   					data:params,
   					success:function(data) {
   						if(data == 'success') {
   							alert("保存成功！");
   							window.location.href="{:U('Admin/Main/userInfo')}";
   						}else if(data == 'error'){
   							alert("修改失败！");
   						}
   					}
   				})
			});
		</script>
	</body>
</html>
